package ranks;

import ranks.base.AppConfig;
import ranks.tasks.calc.Calc;
import ranks.tasks.count_seeds.CountSeeds;
import ranks.tasks.get_ready.GetReady;
import ranks.tasks.readable.Readable;

public class Ranks {

    public static void main(String[] args) throws Exception {
        // AntBuilder.buildXML(Ranks.class);
        // System.exit(0);

        AppConfig config = new AppConfig(args);
        int round = Integer.parseInt(config.get("-round"));

        if (round >= 0) {
            if (round == 0) {
                new CountSeeds(args).submit();
                new GetReady(args).submit();

                round = 1;
            }

            for (;; round++) {
                new Calc(round, args).submit();
            }
        } else {
            new Readable(-round, args).submit();
        }
    }

}
